#coding=utf-8

import hashlib

def to_md5(url):
    if isinstance(url,str):
        url=url.encode("utf-8")
    m=hashlib.md5()
    m.update(url)
    return m.hexdigest()

# if __name__ == "__main__":
#     print (to_md5("https://www.baidu.com"))